interface Animal{
    eat():void;
}
class Cat implements Animal{
    eat(): void {
        console.log("鱼");
        
    }
}
class Dog implements Animal{
    eat(): void {
        console.log("骨头");
        
    }
}
class Farmer{
    feed(obj:Animal){
        obj.eat();
    }
}
var f:Farmer = new Farmer();
f.feed(new Cat());
f.feed(new Dog());